

<%@ page import="com.surelution.tinyerp.PurchaseOrder" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'purchaseOrder.label', default: 'PurchaseOrder')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${purchaseOrderInstance}">
            <div class="errors">
                <g:renderErrors bean="${purchaseOrderInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${purchaseOrderInstance?.id}" />
                <g:hiddenField name="version" value="${purchaseOrderInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="actualFinishTime"><g:message code="purchaseOrder.actualFinishTime.label" default="Actual Finish Time" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'actualFinishTime', 'errors')}">
                                    <g:datePicker name="actualFinishTime" precision="day" value="${purchaseOrderInstance?.actualFinishTime}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="assignTime"><g:message code="purchaseOrder.assignTime.label" default="Assign Time" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'assignTime', 'errors')}">
                                    <g:datePicker name="assignTime" precision="day" value="${purchaseOrderInstance?.assignTime}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="finishTime"><g:message code="purchaseOrder.finishTime.label" default="Finish Time" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'finishTime', 'errors')}">
                                    <g:datePicker name="finishTime" precision="day" value="${purchaseOrderInstance?.finishTime}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="format"><g:message code="purchaseOrder.format.label" default="Format" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'format', 'errors')}">
                                    <g:textField name="format" value="${purchaseOrderInstance?.format}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="getNum"><g:message code="purchaseOrder.getNum.label" default="Get Num" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'getNum', 'errors')}">
                                    <g:textField name="getNum" value="${fieldValue(bean: purchaseOrderInstance, field: 'getNum')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="market"><g:message code="purchaseOrder.market.label" default="Market" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'market', 'errors')}">
                                    <g:select name="market.id" from="${com.surelution.tinyerp.Market.list()}" optionKey="id" optionValue="name" value="${purchaseOrderInstance?.market?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="orderNo"><g:message code="purchaseOrder.orderNo.label" default="Order No" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'orderNo', 'errors')}">
                                    <g:textField name="orderNo" value="${purchaseOrderInstance?.orderNo}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="orderNum"><g:message code="purchaseOrder.orderNum.label" default="Order Num" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'orderNum', 'errors')}">
                                    <g:textField name="orderNum" value="${fieldValue(bean: purchaseOrderInstance, field: 'orderNum')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="planNo"><g:message code="purchaseOrder.planNo.label" default="Plan No" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'planNo', 'errors')}">
                                    <g:textField name="planNo" value="${purchaseOrderInstance?.planNo}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="price"><g:message code="purchaseOrder.price.label" default="Price" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'price', 'errors')}">
                                    <g:textField name="price" value="${fieldValue(bean: purchaseOrderInstance, field: 'price')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="prodType"><g:message code="purchaseOrder.prodType.label" default="Prod Type" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'prodType', 'errors')}">
                                    <g:select name="prodType.id" from="${com.surelution.tinyerp.ProdType.list()}" optionKey="id" optionValue="name" value="${purchaseOrderInstance?.prodType?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="unit"><g:message code="purchaseOrder.unit.label" default="Unit" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'unit', 'errors')}">
                                    <g:select name="unit.id" from="${com.surelution.tinyerp.Unit.list()}" optionKey="id" optionValue="name" value="${purchaseOrderInstance?.unit?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="year"><g:message code="purchaseOrder.year.label" default="Year" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'year', 'errors')}">
                                    <g:datePicker name="year" precision="day" value="${purchaseOrderInstance?.year}"  format="yyyy年"/>
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="remark"><g:message code="purchaseOrder.remark.label" default="remark" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: purchaseOrderInstance, field: 'remark', 'errors')}">
                                    <g:textField name="remark" value="${purchaseOrderInstance?.remark}" />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
